package cn.jiaqiang.chatgpt.data.types.holder;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author: jia-qiang ljq1024.cc
 * @desc:
 * @Date: 2024-05-09-19:03
 */
public class ResponseHolder {

    private static final ThreadLocal<HttpServletResponse> tl = new ThreadLocal<>();

    public static void saveResponse(HttpServletResponse request){
        tl.set(request);
    }

    public static HttpServletResponse getResponse(){
        return tl.get();
    }

    public static void removeResponse(){
        tl.remove();
    }
}
